<template>
    <div>
      <Form ref="eleForm" :model="fig" :rules="rules" style="text-align:left;line-height: normal;"
        label-position="top">
        <Divider style="margin-top:0">组件属性</Divider>
        <FormItem label="分割线文本" style="line-height: normal;">
          <div>
            <Input v-model="fig.text" placeholder="请填写分割线文本"/>
          </div>
        </FormItem>
        <FormItem label="文字位置" style="line-height: normal;"  v-if="fig.type !== 'textarea'">
          <div>
            <Select v-model="fig.attr.orientation" transfer>
              <Option value="center">居中</Option>
              <Option value="left">靠左</Option>
              <Option value="right">靠右</Option>
            </Select>
          </div>
        </FormItem>
        <!-- <FormItem label="分割线类型" style="line-height: normal;"  v-if="fig.type !== 'textarea'">
          <div>
            <Select v-model="fig.attr.type" transfer>
              <Option value="horizontal">水平</Option>
              <Option value="vertical">垂直</Option>
            </Select>
          </div>
        </FormItem> -->
        <div style="display:flex;justify-content: space-between;">
          <div>
            <FormItem label="隐藏节点" style="line-height: normal;">
              <div>
                <SwitchIview v-model="fig.hide"/>
              </div>
            </FormItem>
          </div>
          <div>
            <FormItem label="是否虚线" style="line-height: normal;">
              <div>
                <SwitchIview v-model="fig.attr.dashed"/>
              </div>
            </FormItem>
          </div>
        </div>
        <FormItem label="普通正文" style="line-height: normal;">
            <div>
            <SwitchIview v-model="fig.attr.plain"/>
            </div>
        </FormItem>
      </Form>
    </div>
</template>

<script>
export default {
  name: 'DividerAttr',
  props: {
    config: {
      type: Object,
      default: undefined
    }
  },
  watch: {
    'config': {
      handler: function (e) {
        this.fig = e
      }
    }
  },
  data () {
    return {
      fig: this.config,
      rules: {
      }
    }
  }
}
</script>

<style scoped>

</style>
